function ReaderHomeView(params){
	var win = Ti.UI.createWindow({
		title: params.title,
		backgroundColor: "#FFF"
	});
	
	var file = Ti.Filesystem.getFile('xml/reading.xml');
	var contents = file.read();
	var xmltext = Ti.XML.parseString(contents.text);
	
	if ( file.exists() ) {
		var readingChapters = [];
		var readerHomeView = Titanium.UI.createTableView({
			top: 0,
			height: Ti.UI.FILL,
			backgroundColor: "transparent",
	    	data: readingChapters
		});
		
		var book = xmltext.documentElement.getElementsByTagName('chapter');
		
		for (var i=0; i<book.length; i++) {

			var chapterTitle = book.item(i).getElementsByTagName('chapternumber').item(0).textContent;
			var abstract = book.item(i).getElementsByTagName('abstract').item(0).textContent;
			var hasChild = book.item(i).getElementsByTagName('haschild').item(0).textContent;
						
			var row = Ti.UI.createTableViewRow({
				height: Ti.UI.SIZE,
				width: Ti.UI.SIZE,
				hasChild: hasChild,
				detailTitle: chapterTitle,
				detail: abstract,
				className: "tableRow",
			});
		
			var headerLabel = Ti.UI.createLabel({
				text: chapterTitle,
				font: {
					fontSize: "16dp",
					fontFamily: (Ti.Platform.osname === "android") ? "Aller_Bd" : "Aller",
					fontWeight: "bold" //Android will ignore this
				},
				top: "3dp",
				left: "5dp",
				height: Ti.UI.SIZE,
				color: "#000"
			});
			
			var shortDescription = Ti.UI.createLabel({
				text: abstract,
				font:{
					fontSize: "10dp",
					fontFamily: (Ti.Platform.osname === "android") ? "Aller_Lt" : "Aller Light"
				},
				color: "#000",
				top: "24dp",
				height:"auto",
				left: "5dp"
			});
			
			row.add(headerLabel);
			row.add(shortDescription);

			readingChapters.push(row);		
		}
		readerHomeView.setData(readingChapters);

	}
	win.add(readerHomeView);
	
	return win;
}

module.exports = ReaderHomeView;